﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DevExpress.Xpo;
using DevExpress.Xpo.Metadata;

namespace DataModel.Models
{
    /// <summary>
    /// Класс взноса
    /// </summary>
    public class Payment : BasePersistObject
    {
        public Payment(Session session)
            : base(session)
        {
        }
        protected Payment()
        {
        }
        protected Payment(Session session, DevExpress.Xpo.Metadata.XPClassInfo classInfo)
            : base(session, classInfo)
        {
        }
        private InsurancePolicy _Policy;
        [Association("InsurancePolicy-Payments")]
        public InsurancePolicy Policy
        {
            get
            {
                return _Policy;
            }
            set
            {
                SetPropertyValue("Policy", ref _Policy, value);
            }
        }
        private Money _Summa;
        [Persistent("Summa")]
        public Money Summa
        {
            get
            {
                return _Summa;
            }
            set
            {
                SetPropertyValue("Summa", ref _Summa, value);
            }
        }
        private DateTime _PlanDate;
        [DevExpress.Xpo.DisplayName("Планируемая дата")]
        public DateTime PlanDate
        {
            get
            {
                return _PlanDate;
            }
            set
            {
                SetPropertyValue("PlanDate", ref _PlanDate, value);
            }
        }
        private DateTime _PaymentDate;
        [DevExpress.Xpo.DisplayName("Дата оплаты")]
        public DateTime PaymentDate
        {
            get
            {
                return _PaymentDate;
            }
            set
            {
                SetPropertyValue("PaymentDate", ref _PaymentDate, value);
            }
        }

        private Blank _Blank;
        [DevExpress.Xpo.DisplayName("Бланк")]
        public Blank Blank
        {
            get
            {
                return _Blank;
            }
            set
            {
                SetPropertyValue("Blank", ref _Blank, value);
            }
        }
        private PaymentType _PaymentType;
        [DevExpress.Xpo.Persistent("PaymentType")]
        public PaymentType PaymentType
        {
            get
            {
                return _PaymentType;
            }
            set
            {
                SetPropertyValue("PaymentType", ref _PaymentType, value);
            }
        }
    }

    public enum PaymentType
    {
        Nal = 1,
        BezNal = 2
    }
}
